package com.xuanyuanzi.all_learning.web.controller.sys;

import com.wf.captcha.utils.CaptchaUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author chen.xuan
 * @Description TODO
 * @date 2024/10/28 9:20
 */
@RestController
public class CaptchaController {
/**
 *生成验证码
 *
 *@paramrequest
 *@paramresponse
 *@throwsIOException
 */
        @RequestMapping("/captcha")
public void captcha(HttpServletRequest request, HttpServletResponse response) throws IOException {
//使用这一行代码就可以生成验证码了
CaptchaUtil.out(request,response);
}
}
